#pragma once
// MESSAGE ATTITUDE_BEAM PACKING

#define MAVLINK_MSG_ID_ATTITUDE_BEAM 14

MAVPACKED(
typedef struct __mavlink_attitude_beam_t {
 uint64_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
 float rx_polar; /*< [deg] Polar angle.(-90.0..90.0)(deg)*/
 float rx_pitch; /*< [deg] Pitch angle.(-90.0..90.0)(deg)*/
 float rx_yaw; /*< [deg] Yaw angle.(-180.0..180.0)(deg)*/
 float rx_T; /*< [deg] T angle.(0.0..51.0)(deg)*/
 float rx_ap; /*< [deg] AP angle.(0.0..60.0)(deg)*/
 float rx_theta; /*< [deg] theta angle.(5.0..80.0)(deg)*/
 float rx_phi; /*< [deg] Yaw angle.(170.0..250.0)(deg)*/
 float tx_polar; /*< [deg] Polar angle.(-90.0..90.0)(deg)*/
 float tx_pitch; /*< [deg] Pitch angle.(-90.0..90.0)(deg)*/
 float tx_yaw; /*< [deg] Yaw angle.(-180.0..180.0)(deg)*/
 float tx_T; /*< [deg] T angle.(0.0..51.0)(deg)*/
 float tx_ap; /*< [deg] AP angle.(0.0..60.0)(deg)*/
 float tx_theta; /*< [deg] theta angle.(5.0..80.0)(deg)*/
 float tx_phi; /*< [deg] Yaw angle.(170.0..250.0)(deg)*/
 float omega_x; /*< [deg/sec] angular velocity at x axis*/
 float omega_y; /*< [deg/sec] angular velocity at y axis*/
 float omega_z; /*< [deg/sec] angular velocity at z axis*/
 float rx_freq; /*< [mhz] receive antenna frequency.*/
 float tx_freq; /*< [mhz] transmit antenna frequency.*/
 uint8_t mode; /*<  Current mode*/
}) mavlink_attitude_beam_t;

#define MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN 85
#define MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN 85
#define MAVLINK_MSG_ID_14_LEN 85
#define MAVLINK_MSG_ID_14_MIN_LEN 85

#define MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC 174
#define MAVLINK_MSG_ID_14_CRC 174



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BEAM { \
    14, \
    "ATTITUDE_BEAM", \
    21, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_beam_t, time_boot_ms) }, \
         { "rx_polar", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_beam_t, rx_polar) }, \
         { "rx_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_beam_t, rx_pitch) }, \
         { "rx_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_beam_t, rx_yaw) }, \
         { "rx_T", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_beam_t, rx_T) }, \
         { "rx_ap", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_beam_t, rx_ap) }, \
         { "rx_theta", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_beam_t, rx_theta) }, \
         { "rx_phi", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_beam_t, rx_phi) }, \
         { "tx_polar", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_beam_t, tx_polar) }, \
         { "tx_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_beam_t, tx_pitch) }, \
         { "tx_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_beam_t, tx_yaw) }, \
         { "tx_T", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_beam_t, tx_T) }, \
         { "tx_ap", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_beam_t, tx_ap) }, \
         { "tx_theta", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_beam_t, tx_theta) }, \
         { "tx_phi", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_beam_t, tx_phi) }, \
         { "omega_x", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_beam_t, omega_x) }, \
         { "omega_y", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_beam_t, omega_y) }, \
         { "omega_z", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_beam_t, omega_z) }, \
         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_attitude_beam_t, mode) }, \
         { "rx_freq", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_beam_t, rx_freq) }, \
         { "tx_freq", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_beam_t, tx_freq) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BEAM { \
    "ATTITUDE_BEAM", \
    21, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_beam_t, time_boot_ms) }, \
         { "rx_polar", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_beam_t, rx_polar) }, \
         { "rx_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_beam_t, rx_pitch) }, \
         { "rx_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_beam_t, rx_yaw) }, \
         { "rx_T", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_beam_t, rx_T) }, \
         { "rx_ap", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_beam_t, rx_ap) }, \
         { "rx_theta", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_beam_t, rx_theta) }, \
         { "rx_phi", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_beam_t, rx_phi) }, \
         { "tx_polar", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_beam_t, tx_polar) }, \
         { "tx_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_beam_t, tx_pitch) }, \
         { "tx_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_beam_t, tx_yaw) }, \
         { "tx_T", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_beam_t, tx_T) }, \
         { "tx_ap", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_beam_t, tx_ap) }, \
         { "tx_theta", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_beam_t, tx_theta) }, \
         { "tx_phi", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_beam_t, tx_phi) }, \
         { "omega_x", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_beam_t, omega_x) }, \
         { "omega_y", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_beam_t, omega_y) }, \
         { "omega_z", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_beam_t, omega_z) }, \
         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_attitude_beam_t, mode) }, \
         { "rx_freq", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_beam_t, rx_freq) }, \
         { "tx_freq", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_beam_t, tx_freq) }, \
         } \
}
#endif

/**
 * @brief Pack a attitude_beam message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param rx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param rx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param rx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param rx_T [deg] T angle.(0.0..51.0)(deg)
 * @param rx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param rx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param rx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param tx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param tx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param tx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param tx_T [deg] T angle.(0.0..51.0)(deg)
 * @param tx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param tx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param tx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param omega_x [deg/sec] angular velocity at x axis
 * @param omega_y [deg/sec] angular velocity at y axis
 * @param omega_z [deg/sec] angular velocity at z axis
 * @param mode  Current mode
 * @param rx_freq [mhz] receive antenna frequency.
 * @param tx_freq [mhz] transmit antenna frequency.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_beam_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint64_t time_boot_ms, float rx_polar, float rx_pitch, float rx_yaw, float rx_T, float rx_ap, float rx_theta, float rx_phi, float tx_polar, float tx_pitch, float tx_yaw, float tx_T, float tx_ap, float tx_theta, float tx_phi, float omega_x, float omega_y, float omega_z, uint8_t mode, float rx_freq, float tx_freq)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, rx_polar);
    _mav_put_float(buf, 12, rx_pitch);
    _mav_put_float(buf, 16, rx_yaw);
    _mav_put_float(buf, 20, rx_T);
    _mav_put_float(buf, 24, rx_ap);
    _mav_put_float(buf, 28, rx_theta);
    _mav_put_float(buf, 32, rx_phi);
    _mav_put_float(buf, 36, tx_polar);
    _mav_put_float(buf, 40, tx_pitch);
    _mav_put_float(buf, 44, tx_yaw);
    _mav_put_float(buf, 48, tx_T);
    _mav_put_float(buf, 52, tx_ap);
    _mav_put_float(buf, 56, tx_theta);
    _mav_put_float(buf, 60, tx_phi);
    _mav_put_float(buf, 64, omega_x);
    _mav_put_float(buf, 68, omega_y);
    _mav_put_float(buf, 72, omega_z);
    _mav_put_float(buf, 76, rx_freq);
    _mav_put_float(buf, 80, tx_freq);
    _mav_put_uint8_t(buf, 84, mode);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN);
#else
    mavlink_attitude_beam_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.rx_polar = rx_polar;
    packet.rx_pitch = rx_pitch;
    packet.rx_yaw = rx_yaw;
    packet.rx_T = rx_T;
    packet.rx_ap = rx_ap;
    packet.rx_theta = rx_theta;
    packet.rx_phi = rx_phi;
    packet.tx_polar = tx_polar;
    packet.tx_pitch = tx_pitch;
    packet.tx_yaw = tx_yaw;
    packet.tx_T = tx_T;
    packet.tx_ap = tx_ap;
    packet.tx_theta = tx_theta;
    packet.tx_phi = tx_phi;
    packet.omega_x = omega_x;
    packet.omega_y = omega_y;
    packet.omega_z = omega_z;
    packet.rx_freq = rx_freq;
    packet.tx_freq = tx_freq;
    packet.mode = mode;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BEAM;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
}

/**
 * @brief Pack a attitude_beam message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param rx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param rx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param rx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param rx_T [deg] T angle.(0.0..51.0)(deg)
 * @param rx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param rx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param rx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param tx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param tx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param tx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param tx_T [deg] T angle.(0.0..51.0)(deg)
 * @param tx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param tx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param tx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param omega_x [deg/sec] angular velocity at x axis
 * @param omega_y [deg/sec] angular velocity at y axis
 * @param omega_z [deg/sec] angular velocity at z axis
 * @param mode  Current mode
 * @param rx_freq [mhz] receive antenna frequency.
 * @param tx_freq [mhz] transmit antenna frequency.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_beam_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint64_t time_boot_ms,float rx_polar,float rx_pitch,float rx_yaw,float rx_T,float rx_ap,float rx_theta,float rx_phi,float tx_polar,float tx_pitch,float tx_yaw,float tx_T,float tx_ap,float tx_theta,float tx_phi,float omega_x,float omega_y,float omega_z,uint8_t mode,float rx_freq,float tx_freq)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, rx_polar);
    _mav_put_float(buf, 12, rx_pitch);
    _mav_put_float(buf, 16, rx_yaw);
    _mav_put_float(buf, 20, rx_T);
    _mav_put_float(buf, 24, rx_ap);
    _mav_put_float(buf, 28, rx_theta);
    _mav_put_float(buf, 32, rx_phi);
    _mav_put_float(buf, 36, tx_polar);
    _mav_put_float(buf, 40, tx_pitch);
    _mav_put_float(buf, 44, tx_yaw);
    _mav_put_float(buf, 48, tx_T);
    _mav_put_float(buf, 52, tx_ap);
    _mav_put_float(buf, 56, tx_theta);
    _mav_put_float(buf, 60, tx_phi);
    _mav_put_float(buf, 64, omega_x);
    _mav_put_float(buf, 68, omega_y);
    _mav_put_float(buf, 72, omega_z);
    _mav_put_float(buf, 76, rx_freq);
    _mav_put_float(buf, 80, tx_freq);
    _mav_put_uint8_t(buf, 84, mode);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN);
#else
    mavlink_attitude_beam_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.rx_polar = rx_polar;
    packet.rx_pitch = rx_pitch;
    packet.rx_yaw = rx_yaw;
    packet.rx_T = rx_T;
    packet.rx_ap = rx_ap;
    packet.rx_theta = rx_theta;
    packet.rx_phi = rx_phi;
    packet.tx_polar = tx_polar;
    packet.tx_pitch = tx_pitch;
    packet.tx_yaw = tx_yaw;
    packet.tx_T = tx_T;
    packet.tx_ap = tx_ap;
    packet.tx_theta = tx_theta;
    packet.tx_phi = tx_phi;
    packet.omega_x = omega_x;
    packet.omega_y = omega_y;
    packet.omega_z = omega_z;
    packet.rx_freq = rx_freq;
    packet.tx_freq = tx_freq;
    packet.mode = mode;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BEAM;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
}

/**
 * @brief Encode a attitude_beam struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param attitude_beam C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_beam_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_beam_t* attitude_beam)
{
    return mavlink_msg_attitude_beam_pack(system_id, component_id, msg, attitude_beam->time_boot_ms, attitude_beam->rx_polar, attitude_beam->rx_pitch, attitude_beam->rx_yaw, attitude_beam->rx_T, attitude_beam->rx_ap, attitude_beam->rx_theta, attitude_beam->rx_phi, attitude_beam->tx_polar, attitude_beam->tx_pitch, attitude_beam->tx_yaw, attitude_beam->tx_T, attitude_beam->tx_ap, attitude_beam->tx_theta, attitude_beam->tx_phi, attitude_beam->omega_x, attitude_beam->omega_y, attitude_beam->omega_z, attitude_beam->mode, attitude_beam->rx_freq, attitude_beam->tx_freq);
}

/**
 * @brief Encode a attitude_beam struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param attitude_beam C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_beam_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_beam_t* attitude_beam)
{
    return mavlink_msg_attitude_beam_pack_chan(system_id, component_id, chan, msg, attitude_beam->time_boot_ms, attitude_beam->rx_polar, attitude_beam->rx_pitch, attitude_beam->rx_yaw, attitude_beam->rx_T, attitude_beam->rx_ap, attitude_beam->rx_theta, attitude_beam->rx_phi, attitude_beam->tx_polar, attitude_beam->tx_pitch, attitude_beam->tx_yaw, attitude_beam->tx_T, attitude_beam->tx_ap, attitude_beam->tx_theta, attitude_beam->tx_phi, attitude_beam->omega_x, attitude_beam->omega_y, attitude_beam->omega_z, attitude_beam->mode, attitude_beam->rx_freq, attitude_beam->tx_freq);
}

/**
 * @brief Send a attitude_beam message
 * @param chan MAVLink channel to send the message
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param rx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param rx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param rx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param rx_T [deg] T angle.(0.0..51.0)(deg)
 * @param rx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param rx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param rx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param tx_polar [deg] Polar angle.(-90.0..90.0)(deg)
 * @param tx_pitch [deg] Pitch angle.(-90.0..90.0)(deg)
 * @param tx_yaw [deg] Yaw angle.(-180.0..180.0)(deg)
 * @param tx_T [deg] T angle.(0.0..51.0)(deg)
 * @param tx_ap [deg] AP angle.(0.0..60.0)(deg)
 * @param tx_theta [deg] theta angle.(5.0..80.0)(deg)
 * @param tx_phi [deg] Yaw angle.(170.0..250.0)(deg)
 * @param omega_x [deg/sec] angular velocity at x axis
 * @param omega_y [deg/sec] angular velocity at y axis
 * @param omega_z [deg/sec] angular velocity at z axis
 * @param mode  Current mode
 * @param rx_freq [mhz] receive antenna frequency.
 * @param tx_freq [mhz] transmit antenna frequency.
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_attitude_beam_send(mavlink_channel_t chan, uint64_t time_boot_ms, float rx_polar, float rx_pitch, float rx_yaw, float rx_T, float rx_ap, float rx_theta, float rx_phi, float tx_polar, float tx_pitch, float tx_yaw, float tx_T, float tx_ap, float tx_theta, float tx_phi, float omega_x, float omega_y, float omega_z, uint8_t mode, float rx_freq, float tx_freq)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, rx_polar);
    _mav_put_float(buf, 12, rx_pitch);
    _mav_put_float(buf, 16, rx_yaw);
    _mav_put_float(buf, 20, rx_T);
    _mav_put_float(buf, 24, rx_ap);
    _mav_put_float(buf, 28, rx_theta);
    _mav_put_float(buf, 32, rx_phi);
    _mav_put_float(buf, 36, tx_polar);
    _mav_put_float(buf, 40, tx_pitch);
    _mav_put_float(buf, 44, tx_yaw);
    _mav_put_float(buf, 48, tx_T);
    _mav_put_float(buf, 52, tx_ap);
    _mav_put_float(buf, 56, tx_theta);
    _mav_put_float(buf, 60, tx_phi);
    _mav_put_float(buf, 64, omega_x);
    _mav_put_float(buf, 68, omega_y);
    _mav_put_float(buf, 72, omega_z);
    _mav_put_float(buf, 76, rx_freq);
    _mav_put_float(buf, 80, tx_freq);
    _mav_put_uint8_t(buf, 84, mode);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BEAM, buf, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
#else
    mavlink_attitude_beam_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.rx_polar = rx_polar;
    packet.rx_pitch = rx_pitch;
    packet.rx_yaw = rx_yaw;
    packet.rx_T = rx_T;
    packet.rx_ap = rx_ap;
    packet.rx_theta = rx_theta;
    packet.rx_phi = rx_phi;
    packet.tx_polar = tx_polar;
    packet.tx_pitch = tx_pitch;
    packet.tx_yaw = tx_yaw;
    packet.tx_T = tx_T;
    packet.tx_ap = tx_ap;
    packet.tx_theta = tx_theta;
    packet.tx_phi = tx_phi;
    packet.omega_x = omega_x;
    packet.omega_y = omega_y;
    packet.omega_z = omega_z;
    packet.rx_freq = rx_freq;
    packet.tx_freq = tx_freq;
    packet.mode = mode;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BEAM, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
#endif
}

/**
 * @brief Send a attitude_beam message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_attitude_beam_send_struct(mavlink_channel_t chan, const mavlink_attitude_beam_t* attitude_beam)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_attitude_beam_send(chan, attitude_beam->time_boot_ms, attitude_beam->rx_polar, attitude_beam->rx_pitch, attitude_beam->rx_yaw, attitude_beam->rx_T, attitude_beam->rx_ap, attitude_beam->rx_theta, attitude_beam->rx_phi, attitude_beam->tx_polar, attitude_beam->tx_pitch, attitude_beam->tx_yaw, attitude_beam->tx_T, attitude_beam->tx_ap, attitude_beam->tx_theta, attitude_beam->tx_phi, attitude_beam->omega_x, attitude_beam->omega_y, attitude_beam->omega_z, attitude_beam->mode, attitude_beam->rx_freq, attitude_beam->tx_freq);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BEAM, (const char *)attitude_beam, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
#endif
}

#if MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_attitude_beam_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_boot_ms, float rx_polar, float rx_pitch, float rx_yaw, float rx_T, float rx_ap, float rx_theta, float rx_phi, float tx_polar, float tx_pitch, float tx_yaw, float tx_T, float tx_ap, float tx_theta, float tx_phi, float omega_x, float omega_y, float omega_z, uint8_t mode, float rx_freq, float tx_freq)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, rx_polar);
    _mav_put_float(buf, 12, rx_pitch);
    _mav_put_float(buf, 16, rx_yaw);
    _mav_put_float(buf, 20, rx_T);
    _mav_put_float(buf, 24, rx_ap);
    _mav_put_float(buf, 28, rx_theta);
    _mav_put_float(buf, 32, rx_phi);
    _mav_put_float(buf, 36, tx_polar);
    _mav_put_float(buf, 40, tx_pitch);
    _mav_put_float(buf, 44, tx_yaw);
    _mav_put_float(buf, 48, tx_T);
    _mav_put_float(buf, 52, tx_ap);
    _mav_put_float(buf, 56, tx_theta);
    _mav_put_float(buf, 60, tx_phi);
    _mav_put_float(buf, 64, omega_x);
    _mav_put_float(buf, 68, omega_y);
    _mav_put_float(buf, 72, omega_z);
    _mav_put_float(buf, 76, rx_freq);
    _mav_put_float(buf, 80, tx_freq);
    _mav_put_uint8_t(buf, 84, mode);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BEAM, buf, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
#else
    mavlink_attitude_beam_t *packet = (mavlink_attitude_beam_t *)msgbuf;
    packet->time_boot_ms = time_boot_ms;
    packet->rx_polar = rx_polar;
    packet->rx_pitch = rx_pitch;
    packet->rx_yaw = rx_yaw;
    packet->rx_T = rx_T;
    packet->rx_ap = rx_ap;
    packet->rx_theta = rx_theta;
    packet->rx_phi = rx_phi;
    packet->tx_polar = tx_polar;
    packet->tx_pitch = tx_pitch;
    packet->tx_yaw = tx_yaw;
    packet->tx_T = tx_T;
    packet->tx_ap = tx_ap;
    packet->tx_theta = tx_theta;
    packet->tx_phi = tx_phi;
    packet->omega_x = omega_x;
    packet->omega_y = omega_y;
    packet->omega_z = omega_z;
    packet->rx_freq = rx_freq;
    packet->tx_freq = tx_freq;
    packet->mode = mode;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BEAM, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_BEAM_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN, MAVLINK_MSG_ID_ATTITUDE_BEAM_CRC);
#endif
}
#endif

#endif

// MESSAGE ATTITUDE_BEAM UNPACKING


/**
 * @brief Get field time_boot_ms from attitude_beam message
 *
 * @return [ms] Timestamp (time since system boot).
 */
static inline uint64_t mavlink_msg_attitude_beam_get_time_boot_ms(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint64_t(msg,  0);
}

/**
 * @brief Get field rx_polar from attitude_beam message
 *
 * @return [deg] Polar angle.(-90.0..90.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_polar(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field rx_pitch from attitude_beam message
 *
 * @return [deg] Pitch angle.(-90.0..90.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_pitch(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field rx_yaw from attitude_beam message
 *
 * @return [deg] Yaw angle.(-180.0..180.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_yaw(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field rx_T from attitude_beam message
 *
 * @return [deg] T angle.(0.0..51.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_T(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field rx_ap from attitude_beam message
 *
 * @return [deg] AP angle.(0.0..60.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_ap(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Get field rx_theta from attitude_beam message
 *
 * @return [deg] theta angle.(5.0..80.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_theta(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field rx_phi from attitude_beam message
 *
 * @return [deg] Yaw angle.(170.0..250.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_rx_phi(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field tx_polar from attitude_beam message
 *
 * @return [deg] Polar angle.(-90.0..90.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_polar(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field tx_pitch from attitude_beam message
 *
 * @return [deg] Pitch angle.(-90.0..90.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_pitch(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field tx_yaw from attitude_beam message
 *
 * @return [deg] Yaw angle.(-180.0..180.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_yaw(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field tx_T from attitude_beam message
 *
 * @return [deg] T angle.(0.0..51.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_T(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field tx_ap from attitude_beam message
 *
 * @return [deg] AP angle.(0.0..60.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_ap(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field tx_theta from attitude_beam message
 *
 * @return [deg] theta angle.(5.0..80.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_theta(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field tx_phi from attitude_beam message
 *
 * @return [deg] Yaw angle.(170.0..250.0)(deg)
 */
static inline float mavlink_msg_attitude_beam_get_tx_phi(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field omega_x from attitude_beam message
 *
 * @return [deg/sec] angular velocity at x axis
 */
static inline float mavlink_msg_attitude_beam_get_omega_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field omega_y from attitude_beam message
 *
 * @return [deg/sec] angular velocity at y axis
 */
static inline float mavlink_msg_attitude_beam_get_omega_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  68);
}

/**
 * @brief Get field omega_z from attitude_beam message
 *
 * @return [deg/sec] angular velocity at z axis
 */
static inline float mavlink_msg_attitude_beam_get_omega_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  72);
}

/**
 * @brief Get field mode from attitude_beam message
 *
 * @return  Current mode
 */
static inline uint8_t mavlink_msg_attitude_beam_get_mode(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  84);
}

/**
 * @brief Get field rx_freq from attitude_beam message
 *
 * @return [mhz] receive antenna frequency.
 */
static inline float mavlink_msg_attitude_beam_get_rx_freq(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  76);
}

/**
 * @brief Get field tx_freq from attitude_beam message
 *
 * @return [mhz] transmit antenna frequency.
 */
static inline float mavlink_msg_attitude_beam_get_tx_freq(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  80);
}

/**
 * @brief Decode a attitude_beam message into a struct
 *
 * @param msg The message to decode
 * @param attitude_beam C-struct to decode the message contents into
 */
static inline void mavlink_msg_attitude_beam_decode(const mavlink_message_t* msg, mavlink_attitude_beam_t* attitude_beam)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    attitude_beam->time_boot_ms = mavlink_msg_attitude_beam_get_time_boot_ms(msg);
    attitude_beam->rx_polar = mavlink_msg_attitude_beam_get_rx_polar(msg);
    attitude_beam->rx_pitch = mavlink_msg_attitude_beam_get_rx_pitch(msg);
    attitude_beam->rx_yaw = mavlink_msg_attitude_beam_get_rx_yaw(msg);
    attitude_beam->rx_T = mavlink_msg_attitude_beam_get_rx_T(msg);
    attitude_beam->rx_ap = mavlink_msg_attitude_beam_get_rx_ap(msg);
    attitude_beam->rx_theta = mavlink_msg_attitude_beam_get_rx_theta(msg);
    attitude_beam->rx_phi = mavlink_msg_attitude_beam_get_rx_phi(msg);
    attitude_beam->tx_polar = mavlink_msg_attitude_beam_get_tx_polar(msg);
    attitude_beam->tx_pitch = mavlink_msg_attitude_beam_get_tx_pitch(msg);
    attitude_beam->tx_yaw = mavlink_msg_attitude_beam_get_tx_yaw(msg);
    attitude_beam->tx_T = mavlink_msg_attitude_beam_get_tx_T(msg);
    attitude_beam->tx_ap = mavlink_msg_attitude_beam_get_tx_ap(msg);
    attitude_beam->tx_theta = mavlink_msg_attitude_beam_get_tx_theta(msg);
    attitude_beam->tx_phi = mavlink_msg_attitude_beam_get_tx_phi(msg);
    attitude_beam->omega_x = mavlink_msg_attitude_beam_get_omega_x(msg);
    attitude_beam->omega_y = mavlink_msg_attitude_beam_get_omega_y(msg);
    attitude_beam->omega_z = mavlink_msg_attitude_beam_get_omega_z(msg);
    attitude_beam->rx_freq = mavlink_msg_attitude_beam_get_rx_freq(msg);
    attitude_beam->tx_freq = mavlink_msg_attitude_beam_get_tx_freq(msg);
    attitude_beam->mode = mavlink_msg_attitude_beam_get_mode(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN;
        memset(attitude_beam, 0, MAVLINK_MSG_ID_ATTITUDE_BEAM_LEN);
    memcpy(attitude_beam, _MAV_PAYLOAD(msg), len);
#endif
}
